import request from '@/utils/request';

// 查询仓库列表
export function listWarehouse(query: Record<string, any>) {
  return request({
    url: '/wms/warehouse/list',
    method: 'get',
    params: query
  })
}

// 查询仓库详细
export function getWarehouse(warehouseId: string | number) {
  return request({
    url: '/wms/warehouse/' + warehouseId,
    method: 'get'
  })
}

// 新增仓库
export function addWarehouse(data: Record<string, any>) {
  return request({
    url: '/wms/warehouse',
    method: 'post',
    data: data
  })
}

// 修改仓库
export function updateWarehouse(data: Record<string, any>) {
  return request({
    url: '/wms/warehouse',
    method: 'put',
    data: data
  })
}

// 删除仓库
export function delWarehouse(warehouseId: string | number | string[]) {
  const ids = Array.isArray(warehouseId) ? warehouseId.join(',') : warehouseId;
  return request({
    url: '/wms/warehouse/' + ids,
    method: 'delete'
  })
}

// 导出仓库
export function exportWarehouse(query: Record<string, any>) {
  return request({
    url: '/wms/warehouse/export',
    method: 'post',
    data: query
  })
}

// 获取仓库下拉列表
export function getWarehouseOptions() {
  return request({
    url: '/wms/warehouse/listNoPage',
    method: 'get'
  })
}




